﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMTP.Master" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="SQT.tracnghiem.Admin.Report" %>

<%@ Import Namespace="DataAccess" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/Chart.bundle.js"></script>
    <script src="../Ajax/JS/Report.js"></script>
    <script src="../Ajax/JS/Certificate.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%
        var get_manager_role = new TblManagerRoleController().FetchAll().First();
    %>
    <div id="main-admin" class="admin-df w3-row w3-light-grey">
        <header class="w3-padding w3-large w3-center w3-teal">THỐNG KÊ</header>

        <div class="w3-row">
            <div class="w3-half w3-padding">
                <div id="canvas-holder" class="w3-white w3-card-2">
                    <div class="w3-row w3-padding w3-small">
                        <select style="padding: 0.3%" id="report_student_type">
                            <option value="2">Lớp</option>
                            <option value="3">Giáo viên</option>
                        </select>

                        <select style="padding: 0.3%" id="report_student_class">
                            <option value="-1">Tất cả lớp</option>
                            <%foreach (TblClass cls in new TblClassController().FetchAll().Where(x => x.Active == true && x.Id != 0))
                              {%>
                            <option value="<%=cls.Id %>"><%=cls.ClassName %></option>
                            <%} %>
                        </select>
                        <select id="report_student_teacher" style="padding: 0.3%; display: none">
                            <%foreach (TblManager admin in new TblManagerController().FetchAll().Where(x => x.Role == 2))
                              { %>
                            <option value="<%=admin.ManagerId %>"><%=admin.FullName %></option>
                            <%} %>
                        </select>
                        <select style="padding: 0.3%" id="report_student_time">
                            <option value="1">Ngày</option>
                            <option value="2">Tháng</option>
                            <option value="3">Năm</option>
                        </select>
                        <%string date = DateTime.Now.Year.ToString();
                          if (DateTime.Now.Month < 10)
                          {
                              date += "-0";
                              date += DateTime.Now.Month.ToString();
                          }
                          else
                              date += "-" + DateTime.Now.Month.ToString();
                          if (DateTime.Now.Day < 10)
                          {
                              date += "-0";
                              date += DateTime.Now.Day.ToString();
                          }
                          else date += "-" + DateTime.Now.Day.ToString();
                        %>
                        <input id="report_student_day" style="padding: 0 0.1%; width: 27%" type="date" value="<%=date %>" />
                        <select id="report_student_month" style="padding: 0.3%; display: none">
                            <%for (int i = 1; i <= 12; i++)
                              {%>
                            <option value="<%=i %>">Tháng <%=i %></option>
                            <%} %>
                        </select>
                        <select id="report_student_year" style="padding: 0.3%; display: none">
                            <%for (int i = DateTime.Now.Year; i >= DateTime.Now.Year - 10; i--)
                              { %>
                            <option value="<%=i %>"><%=i %></option>
                            <%} %>
                        </select>
                        <a class="btn_report_student w3-btn w3-teal" title="Tra cứu"><i class="fa fa-bar-chart"></i></a>
                    </div>
                    <div id="number_area" class="w3-hide">
                        <div id="early" class="w3-hide"><%=this.early%></div>
                        <div id="late" class="w3-hide"><%=this.late %></div>
                        <div id="absent_yes" class="w3-hide"><%=this.absent_yes %></div>
                        <div id="absent_no" class="w3-hide"><%=this.absent_no %></div>
                    </div>
                    <div id="myCanvas">
                        <canvas id="chart-area" />
                    </div>
                </div>
            </div>
            
        </div>
    </div>
</asp:Content>
